package com.example.anew.journey.mynewjourney.logic.getVersion.model;

import android.content.Context;
import android.content.SharedPreferences;

import com.example.anew.journey.mynewjourney.logic.getVersion.bean.PasswordFreeLoginBean;

import static android.content.Context.MODE_PRIVATE;

/**
 * 杭州惟君医疗科技有限公司17
 * Created by 20433 on 2018/3/23
 *
 * @desc 东风山河绿，春已不折柳，繁花看不尽，处处惹人留
 * @desc 佛祖镇楼，bug辟容易
 */

public class GetVersionModel implements ISGetVersionModel {

    @Override
    public void saveDate(PasswordFreeLoginBean.DataBean bean, Context mContext) {
        SharedPreferences sharedPreferences = mContext.getSharedPreferences("My_App_Cardiac", MODE_PRIVATE);
        //得到SharedPreferences.Editor对象，并保存数据到该对象中
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putString("my_use_id", bean.id);
        editor.putString("my_use_name", bean.cus_name);
        editor.putString("my_use_tel", bean.tel);
        editor.putString("my_use_logo", bean.cus_logo);
        editor.putString("my_use_birthday", bean.birthday);
        editor.putString("my_use_qq", bean.qq);
        editor.putString("my_use_weixin", bean.weixin);
        editor.putString("my_use_token", bean.token);
        editor.putBoolean("my_is_login",true);
        editor.putInt("my_stored_data_number",1);
        //保存key-value对到文件中
        editor.commit();
    }
}
